{ "swagger": "2.0", "info": { "version": "1.0.0", "title": "Africa's Talking Payments", "description": "Charge and send payments to more than 300 million mobile, bank and card account holders across Africa.", "contact": { "name": "Advice and answers from the Africa's Talking Team", "url": "https://help.africastalking.com/en/", "email": "payments@africastalking.com" } }, "host": "payments.africastalking.com", "basePath": "/", "schemes": [ "https" ], "consumes": [ "application/json" ], "produces": [ "application/json" ], "paths": { "/mobile/b2b/request": { "post": { "summary": "Mobile B2B (Business to Business)", "description": "Send payments to businesses e.g banks from your Payment Wallet.", "operationId": "MobileB2B", "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "username": { "type": "string", "description": "Your application username.", "title": "Username", "x-ms-visibility": "important" }, "productName": { "type": "string", "description": "Your Africa's Talking Payment Product to initiate this transaction.", "title": "Product Name", "x-ms-visibility": "important" }, "provider": { "type": "string", "description": "Provider that will be used to process the B2B request.", "title": "Provider", "x-ms-visibility": "important", "enum": [ "Mpesa", "TigoTanzania", "Athena" ] }, "transferType": { "type": "string", "description": "Transfer type of the payment.", "title": "Transfer type", "x-ms-visibility": "important", "enum": [ "BusinessBuyGoods", "BusinessPayBill", "DisburseFundsToBusiness", "BusinessToBusinessTransfer" ] }, "currencyCode": { "type": "string", "description": "Currency code for the value of this transaction", "title": "Currency Code", "x-ms-visibility": "important", "enum": [ "KES", "UGX", "NGN", "USD", "TZS" ] }, "amount": { "type": "number", "format": "float", "description": "Amount - in the provided currency - that the client is expected to confirm.", "title": "Amount", "x-ms-visibility": "important" }, "destinationChannel": { "type": "string", "description": "The name/number of the channel that will receive payment.", "title": "Destination Channel", "x-ms-visibility": "important" }, "destinationAccount": { "type": "string", "description": "The account name used by the business to receive money.", "title": "Destination Account", "x-ms-visibility": "important" }, "metadata": { "type": "object", "properties": {}, "description": "metadata", "default": {}, "x-ms-visibility": "advanced" } }, "default": { "username": "sandbox", "productName": "TestProduct", "provider": "Athena", "transferType": "BusinessPayBill", "currencyCode": "KES", "amount": 100, "destinationChannel": "partnerBussinessChannel", "destinationAccount": "parterAccountName", "metadata": {} }, "x-ms-visibility": "important", "required": [ "username", "productName", "provider", "transferType", "currencyCode", "amount", "destinationAccount", "destinationChannel" ] }, "required": true, "x-ms-visibility": "important" } ], "responses": { "201": { "description": "201", "schema": { "type": "object", "properties": { "providerChannel": { "type": "string", "description": "providerChannel" }, "status": { "type": "string", "description": "status" }, "transactionFee": { "type": "string", "description": "transactionFee" }, "transactionId": { "type": "string", "description": "transactionId" } } } } }, "x-ms-visibility": "important" } }, "/query/wallet/balance": { "get": { "summary": "Fetch Wallet Balance", "description": "Fetch your wallet balance.", "operationId": "FetchWalletBalance", "parameters": [ { "name": "username", "in": "query", "type": "string", "required": true, "x-ms-visibility": "important", "description": "Your application username.", "x-ms-summary": "Username" } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "balance": { "type": "string", "description": "balance" }, "status": { "type": "string", "description": "status" } } } } }, "x-ms-visibility": "important" } }, "/transfer/wallet": { "post": { "summary": "Wallet transfer", "description": "Transfer money from one Payment Product to another Payment Product hosted on Africa's Talking.", "operationId": "WalletTransfer", "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "username": { "type": "string", "description": "Your application's username.", "title": "Username", "x-ms-visibility": "important" }, "productName": { "type": "string", "description": "Your Africa's Talking Payment product to initiate this transaction.", "title": "Product Name", "x-ms-visibility": "important" }, "targetProductCode": { "type": "integer", "format": "int32", "description": "Unique product code of the Africa's Talking Payment Product to transfer the funds to.", "title": "Target Product Code", "x-ms-visibility": "important" }, "currencyCode": { "type": "string", "description": "Currency code for the value of this transaction.", "title": "Currency Code", "x-ms-visibility": "important", "enum": [ "KES", "UGX", "USD", "TZS" ] }, "amount": { "type": "number", "format": "float", "description": "Amount - in the provided currency - that the application will be topped up with.", "title": "Amount", "x-ms-visibility": "important" }, "metadata": { "type": "object", "properties": {}, "description": "metadata", "default": {}, "x-ms-visibility": "advanced" } }, "default": { "username": "sandbox", "productName": "TestProduct", "targetProductCode": 6531, "currencyCode": "KES", "amount": 1000, "metadata": {} }, "x-ms-visibility": "important", "required": [ "username", "productName", "targetProductCode", "currencyCode", "amount" ] }, "required": true, "x-ms-visibility": "important" } ], "responses": { "201": { "description": "201", "schema": { "type": "object", "properties": { "description": { "type": "string", "description": "description" }, "status": { "type": "string", "description": "status" }, "transactionId": { "type": "string", "description": "transactionId" } } } } }, "x-ms-visibility": "important" } }, "/query/wallet/fetch": { "get": { "summary": "Fetch Wallet Transactions", "description": "Fetch your wallet transactions.", "operationId": "FetchWalletTransactions", "parameters": [ { "name": "username", "in": "query", "type": "string", "required": true, "x-ms-visibility": "important", "description": "Your application username", "x-ms-summary": "Username" }, { "name": "pageNumber", "default": 1, "in": "query", "type": "integer", "required": true, "format": "int32", "x-ms-visibility": "advanced", "description": "The number of the page you'd like to read results from", "x-ms-summary": "Page Number" }, { "name": "count", "default": 100, "in": "query", "type": "integer", "required": true, "format": "int32", "x-ms-visibility": "advanced", "description": "The number of transaction results you would like for this query.", "x-ms-summary": "Count" }, { "name": "startDate", "in": "query", "type": "string", "required": false, "x-ms-visibility": "advanced", "format": "", "description": "Transaction start date you would like to consider in the format YYYY-MM-DD.", "x-ms-summary": "Start Date" }, { "name": "endDate", "in": "query", "type": "string", "required": false, "x-ms-visibility": "advanced", "description": "Transaction end date you would like to consider in the format YYYY-MM-DD", "x-ms-summary": "End Date" } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "status": { "type": "string", "description": "status" }, "responses": { "type": "array", "items": { "type": "object", "properties": { "description": { "type": "string", "description": "description" }, "balance": { "type": "string", "description": "balance" }, "date": { "type": "string", "description": "date" }, "category": { "type": "string", "description": "category" }, "transactionData": { "type": "object", "properties": { "requestMetadata": { "type": "object", "properties": { "reason": { "type": "string", "description": "reason" } }, "description": "requestMetadata" }, "sourceType": { "type": "string", "description": "sourceType" }, "source": { "type": "string", "description": "source" }, "provider": { "type": "string", "description": "provider" }, "destinationType": { "type": "string", "description": "destinationType" }, "description": { "type": "string", "description": "description" }, "providerChannel": { "type": "string", "description": "providerChannel" }, "transactionFee": { "type": "string", "description": "transactionFee" }, "providerRefId": { "type": "string", "description": "providerRefId" }, "providerMetadata": { "type": "object", "properties": { "recipientIsRegistered": { "type": "string", "description": "recipientIsRegistered" }, "recipientName": { "type": "string", "description": "recipientName" } }, "description": "providerMetadata" }, "status": { "type": "string", "description": "status" }, "productName": { "type": "string", "description": "productName" }, "category": { "type": "string", "description": "category" }, "transactionDate": { "type": "string", "description": "transactionDate" }, "destination": { "type": "string", "description": "destination" }, "value": { "type": "string", "description": "value" }, "transactionId": { "type": "string", "description": "transactionId" }, "creationTime": { "type": "string", "description": "creationTime" } }, "description": "transactionData" }, "value": { "type": "string", "description": "value" }, "transactionId": { "type": "string", "description": "transactionId" } } }, "description": "responses" } } } } } } }, "/topup/stash": { "post": { "summary": "Top Up Stash", "description": "Move money from a Payment Product to an Africa's Talking application stash.", "operationId": "TopUpStash", "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "username": { "type": "string", "description": "Your application username.", "title": "Username", "x-ms-visibility": "important" }, "productName": { "type": "string", "description": "Africa's Talking Payment product to initiate this transaction.", "title": "Product Name", "x-ms-visibility": "important" }, "currencyCode": { "type": "string", "description": "Currency code for the value of this transaction", "title": "Currency Code", "x-ms-visibility": "important", "enum": [ "KES", "UGX", "USD", "TZS" ] }, "amount": { "type": "number", "format": "float", "description": "Amount - in the provided currency - that the application will be topped up with.", "title": "Amount", "x-ms-visibility": "important" }, "metadata": { "type": "object", "properties": {}, "description": "metadata", "default": {}, "x-ms-visibility": "advanced" } }, "default": { "username": "sandbox", "productName": "TestProduct", "currencyCode": "KES", "amount": 1000, "metadata": {} }, "required": [ "username", "productName", "currencyCode", "amount" ], "x-ms-visibility": "important" }, "required": true, "x-ms-visibility": "important" } ], "responses": { "201": { "description": "201", "schema": { "type": "object", "properties": { "description": { "type": "string", "description": "description" }, "status": { "type": "string", "description": "status" }, "transactionId": { "type": "string", "description": "transactionId" } } } } }, "x-ms-visibility": "important" } }, "/query/transaction/fetch": { "get": { "summary": "Fetch Product Transactions", "description": "Fetch transactions of a particular payment product.", "operationId": "FetchProductTransactions", "parameters": [ { "name": "username", "in": "query", "type": "string", "required": true, "x-ms-visibility": "important", "description": "Your application username.", "x-ms-summary": "Username" }, { "name": "productName", "in": "query", "type": "string", "required": true, "x-ms-visibility": "important", "description": "The name of the payment product whose transactions you'd like to fetch.", "x-ms-summary": "Product Name" }, { "name": "pageNumber", "default": 1, "in": "query", "type": "integer", "required": true, "x-ms-visibility": "advanced", "description": "The number of the page you'd like to read results from.", "x-ms-summary": "Page Number", "format": "int32" }, { "name": "count", "default": 100, "in": "query", "type": "integer", "required": true, "x-ms-visibility": "advanced", "x-ms-summary": "Count", "description": "The number of transaction results you would like for this query.", "format": "int32" }, { "name": "startDate", "in": "query", "type": "string", "required": false, "x-ms-visibility": "advanced", "description": "Transaction start date you would like to consider in the format YYYY-MM-DD", "x-ms-summary": "Start Date" }, { "name": "endDate", "in": "query", "type": "string", "required": false, "x-ms-visibility": "advanced", "description": "Transaction end date you would like to consider in the format YYYY-MM-DD.", "x-ms-summary": "End Date" }, { "name": "category", "in": "query", "type": "string", "required": false, "x-ms-visibility": "advanced", "enum": [ "BankCheckout", "CardCheckout", "MobileCheckout", "MobileC2B", "MobileB2C", "MobileB2B", "BankTransfer", "WalletTransfer", "UserStashTopup" ], "description": "Transaction category you would like to consider.", "x-ms-summary": "Category" }, { "name": "provider", "in": "query", "type": "string", "required": false, "x-ms-visibility": "advanced", "enum": [ "Mpesa", "Segovia", "Flutterwave", "Admin", "Athena" ], "description": "Transaction provider you would like to consider.", "x-ms-summary": "Provider" }, { "name": "status", "in": "query", "type": "string", "required": false, "x-ms-visibility": "advanced", "enum": [ "Success", "Failed" ], "description": "Transaction status you would like to consider.", "x-ms-summary": "Status" }, { "name": "source", "in": "query", "type": "string", "required": false, "x-ms-visibility": "advanced", "enum": [ "phoneNumber", "BankAccount", "Card", "Wallet" ], "description": "Transaction source you would like to consider.", "x-ms-summary": "Source" }, { "name": "destination", "in": "query", "type": "string", "required": false, "x-ms-visibility": "advanced", "enum": [ "phoneNumber", "BankAccount", "Card", "Wallet" ], "description": "Transaction destination you would like to consider.", "x-ms-summary": "Destination" }, { "name": "providerChannel", "in": "query", "type": "string", "required": false, "x-ms-visibility": "advanced", "description": "Transaction provider channel you would like to consider.", "x-ms-summary": "Provider Channel" } ], "responses": { "200": { "description": "200", "schema": { "type": "object", "properties": { "description": { "type": "string", "description": "description" }, "status": { "type": "string", "description": "status" }, "responses": { "type": "array", "items": { "type": "object", "properties": { "requestMetadata": { "type": "object", "properties": { "reason": { "type": "string", "description": "reason" } }, "description": "requestMetadata" }, "sourceType": { "type": "string", "description": "sourceType" }, "source": { "type": "string", "description": "source" }, "provider": { "type": "string", "description": "provider" }, "destinationType": { "type": "string", "description": "destinationType" }, "description": { "type": "string", "description": "description" }, "providerChannel": { "type": "string", "description": "providerChannel" }, "transactionFee": { "type": "string", "description": "transactionFee" }, "providerRefId": { "type": "string", "description": "providerRefId" }, "providerMetadata": { "type": "object", "properties": { "recipientIsRegistered": { "type": "string", "description": "recipientIsRegistered" }, "recipientName": { "type": "string", "description": "recipientName" } }, "description": "providerMetadata" }, "status": { "type": "string", "description": "status" }, "productName": { "type": "string", "description": "productName" }, "category": { "type": "string", "description": "category" }, "transactionDate": { "type": "string", "description": "transactionDate" }, "destination": { "type": "string", "description": "destination" }, "value": { "type": "string", "description": "value" }, "transactionId": { "type": "string", "description": "transactionId" }, "creationTime": { "type": "string", "description": "creationTime" } } }, "description": "responses" } } } } }, "x-ms-visibility": "important" } }, "/mobile/checkout/request": { "post": { "summary": "Mobile Checkout", "description": "Initiate a Customer to Business (C2B) payments on a mobile subscriber's device.", "operationId": "MobileCheckout", "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "username": { "type": "string", "description": "Your application username.", "title": "Username", "x-ms-visibility": "important" }, "productName": { "type": "string", "description": "Your Africa's Talking Payment product to initiate this transaction.", "title": "Product Name", "x-ms-visibility": "important" }, "providerChannel": { "type": "string", "description": "The provider channel the payment will be initiated from e.g a paybill number.", "title": "Provider Channel", "x-ms-visibility": "advanced" }, "phoneNumber": { "type": "string", "description": "Phone number - in international format - of the client that will complete this transaction.", "title": "Phone Number", "x-ms-visibility": "important" }, "currencyCode": { "type": "string", "description": "Currency code for the value of this transaction.", "title": "Currency Code", "x-ms-visibility": "important", "enum": [ "KES", "UGX", "TZS", "USD" ] }, "amount": { "type": "number", "format": "float", "description": "Amount - in the provided currency - that the client is expected to confirm.", "title": "Amount", "x-ms-visibility": "important" }, "metadata": { "type": "object", "properties": {}, "description": "metadata", "default": {}, "x-ms-visibility": "advanced" } }, "default": { "username": "sandbox", "productName": "TestProduct", "providerChannel": "1212", "phoneNumber": "+254738523316", "currencyCode": "KES", "amount": 1000, "metadata": {} }, "required": [ "username", "productName", "phoneNumber", "currencyCode", "amount" ], "x-ms-visibility": "important" }, "required": true, "x-ms-visibility": "important" } ], "responses": { "201": { "description": "201", "schema": { "type": "object", "properties": { "description": { "type": "string", "description": "description" }, "providerChannel": { "type": "string", "description": "providerChannel" }, "status": { "type": "string", "description": "status" }, "transactionId": { "type": "string", "description": "transactionId" } } } } }, "x-ms-visibility": "important" } }, "/mobile/b2c/request": { "post": { "summary": "Mobile B2C (Business to Consumer)", "description": "Send payments to mobile subscribers from your Payment Wallet.", "operationId": "MobileB2C", "parameters": [ { "name": "body", "in": "body", "schema": { "type": "object", "properties": { "username": { "type": "string", "description": "Your application username.", "title": "Username", "x-ms-visibility": "important" }, "productName": { "type": "string", "description": "Africa's Talking Payment Product to initiate this transaction.", "title": "Product Name", "x-ms-visibility": "important" }, "recipients": { "type": "array", "items": { "type": "object", "properties": { "phoneNumber": { "type": "string", "description": "Phone number of the B2C transaction recipient.", "title": "Phone Number", "x-ms-visibility": "important" }, "currencyCode": { "type": "string", "description": "Currency code for the value of this transaction.", "title": "Currency Code", "x-ms-visibility": "important", "enum": [ "KES", "UGX", "TZS", "USD" ] }, "amount": { "type": "number", "format": "float", "description": "Amount - in the provided currency - that the client is expected to confirm.", "title": "Amount", "x-ms-visibility": "important" }, "providerChannel": { "type": "string", "description": "The channel the payment will be made from e.g a paybill number.", "title": "Provider channel" }, "reason": { "type": "string", "description": "Purpose of the payment.", "title": "Reason", "enum": [ "SalaryPayment", "SalaryPaymentWithWithdrawalChargePaid", "BusinessPayment", "BusinessPaymentWithWithdrawalChargePaid", "PromotionPayment" ], "x-ms-visibility": "advanced" }, "name": { "type": "string", "description": "Name of the B2C transaction recipient.", "title": "Name", "x-ms-visibility": "advanced" }, "metadata": { "type": "object", "properties": {}, "description": "metadata", "default": {}, "x-ms-visibility": "advanced" } }, "required": [ "amount", "currencyCode", "phoneNumber" ] }, "description": "recipients" } }, "default": { "username": "sandbox", "productName": "TestProduct", "recipients": [ { "phoneNumber": "+254795790363", "currencyCode": "KES", "amount": 130, "providerChannel": "1212", "reason": "BusinessPayment", "name": "Recipient_name", "metadata": {} }, { "phoneNumber": "+254795790363", "currencyCode": "KES", "amount": 130, "providerChannel": "1212", "reason": "BusinessPayment", "name": "Recipient_name", "metadata": {} } ] }, "required": [ "username", "productName", "recipients" ] }, "required": true } ], "responses": { "201": { "description": "201", "schema": { "type": "object", "properties": { "entries": { "type": "array", "items": { "type": "object", "properties": { "phoneNumber": { "type": "string", "description": "phoneNumber" }, "provider": { "type": "string", "description": "provider" }, "providerChannel": { "type": "string", "description": "providerChannel" }, "status": { "type": "string", "description": "status" }, "transactionId": { "type": "string", "description": "transactionId" }, "value": { "type": "string", "description": "value" }, "transactionFee": { "type": "string", "description": "transactionFee" } } }, "description": "entries" }, "numQueued": { "type": "integer", "format": "int32", "description": "numQueued" }, "totalTransactionFee": { "type": "string", "description": "totalTransactionFee" }, "totalValue": { "type": "string", "description": "totalValue" } } } } }, "x-ms-visibility": "important" } } }, "x-ms-connector-metadata": [ { "propertyName": "Website", "propertyValue": "https://africastalking.com/payments" }, { "propertyName": "Privacy policy", "propertyValue": "https://africastalking.com/privacy_policy" }, { "propertyName": "Categories", "propertyValue": "Finance" } ], "definitions": {}, "parameters": {}, "responses": {}, "securityDefinitions": { "API Key": { "type": "apiKey", "in": "header", "name": "apiKey" } }, "security": [ { "API Key": [] } ], "tags": [] }